<template>
  <view class="count" :style="{ buttom: '0px', left: 0 + 'px' }">
    <view class="left" @click="home(1)">
      <image v-if="numBer == 1" style="height: 48rpx;width: 48rpx;" src="/static/tabBar/tabBar_home@2x.png" mode=""></image>
      <image v-else style="height: 48rpx;width: 48rpx;" src="/static/tabBar/tabBar_home@2x(1).png" mode=""></image>
    </view>
    <view class="left_2" @click="home(2)">
      <image v-if="numBer == 2" style="height: 48rpx;width: 48rpx;" src="/static/tabBar/tabBar_class@2x.png" mode=""></image>
      <image v-else style="height: 48rpx;width: 48rpx;" src="/static/tabBar/tabBar_class@2x(1).png" mode=""></image>
    </view>
    <view class="center" @click="home(3)">
      <image v-if="numBer == 3" style="height: 80rpx;width: 80rpx;" src="/static/tabBar/06cf8ff9-f010-48ce-aa99-d3e179ea6f9e 2@2x.png" mode=""></image>
      <image v-else style="height: 80rpx;width: 80rpx;" src="/static/tabBar/06cf8ff9-f010-48ce-aa99-d3e179ea6f9e 2@2x(1).png" mode=""></image>
    </view>
    <view class="left_2" @click="home(4)">
      <image v-if="numBer == 4" style="height: 48rpx;width: 48rpx;" src="/static/tabBar/tabBar_Shopping Cart@2x.png" mode=""></image>
      <image v-else style="height: 48rpx;width: 48rpx;" src="/static/tabBar/tabBar_Shopping Cart@2x(1).png" mode=""></image>
    </view>
    <view class="left_2" @click="home(5)">
      <image v-if="numBer == 5" style="height: 48rpx;width: 48rpx;" src="/static/tabBar/tabBar_user@2x.png" mode=""></image>
      <image v-else style="height: 48rpx;width: 48rpx;" src="/static/tabBar/tabBar_user@2x(1).png" mode=""></image>
    </view>
  </view>
</template>

<script>
export default {
  props: {
    top: {
      type: Number,
      default: 0
    },
    numBer: {
      type: String,
      default: '1'
    }
  },
  data() {
    return {
      state: '1'
    };
  },
  onLoad() {
    // this.state = uni.getStorageSync('state');
  },
  methods: {
    home(data) {
      // uni.setStorageSync('state', data);
      this.state = data;
      if (data == 1) {
        // 首页
        // 第二个搜索
        uni.switchTab({
          url: '/pages/index/index'
        });
        // this.state = 1;
      } else if (data == 2) {
        // 第二个搜索
        uni.switchTab({
          url: '/pages/search/search'
        });
        // this.state = 2;
      } else if (data == 3) {
        // 第三个
        uni.switchTab({
          url: '/pages/aboutYama/aboutYama'
        });
      } else if (data == 4) {
        // 第四个
        uni.switchTab({
          url: '/pages/shooping/shooping'
        });
      } else if (data == 5) {
        // 第五个
        uni.switchTab({
          url: '/pages/my/my'
        });
      }
    }
  }
};
</script>
<style lang="scss">
.count {
  z-index: 9999999999999999;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100rpx;
  display: flex;
  align-items: center;
  justify-content: space-around;
  background-color: #fff;
}
</style>
